分类
联系方式
  1. 新浪微博
  2. E-mail

Racket 条件判断

if 表达式

(if (positive? -5) (error "doesn't get here") 2)

(if 'this-is-a-symbol "yes" "no")

cond 表达式

(define score 95)
(cond [(> score 90) "A"]
      [(> score 70) "B"]
      [(> score 60) "Pass"]
      [else "Not Pass"])

and or 逻辑判断

分别是 andor